package org.example.Test;

import java.util.HashSet;
import java.util.Set;

public class Test3 {
    public static void main(String[] args) {
        int total = 100; // 指定生成的总数量
        Set<String> idSet = new HashSet<>();

        int count = 0;
        for (int i = 0; count < total; i++) {
            count += test2(i, idSet, total - count);
        }
    }

    private static int test2(Integer i, Set<String> idSet, int remaining) {
        int count = 0;
        for (int j = 0; j < 10; j++) {
            String id = getID(i * 9, j);
            if (idSet.contains(id)) {
                // 如果ID已存在，则跳过该ID
                continue;
            }
            idSet.add(id);
            System.out.println(id + "\n");
            count++;
            if (count >= remaining) {
                break;
            }
        }
        return count;
    }

    private static String getID(int i, int j) {
        String b = "";
        Long c = Long.valueOf(i + j);
        for (int k = 0; k < 14 - String.valueOf(c).length(); k++) {
            b += "0";
        }
        b += c;
        return b;
    }
}
